{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "zhangsan\n",
      "80\n",
      "90\n",
      "70\n",
      "100\n",
      "89\n",
      "lisi\n",
      "chinese 89\n",
      "english 78\n",
      "math 96\n",
      "physics 88\n",
      "1 2\n",
      "(3, 4, 5)\n",
      "weather 30\n",
      "tempreature 22\n"
     ]
    }
   ],
   "source": [
    "#args,kwargs分别可以表示多个之和字典\n",
    "def show(student, *args):\n",
    "    print(student)\n",
    "    for score in args:\n",
    "        print(score)\n",
    "\n",
    "show('zhangsan', 80,90,70,100,89)\n",
    "\n",
    "def show2(student, **kwargs):\n",
    "    print(student)\n",
    "    for key, value in kwargs.items():\n",
    "        print(key, value)\n",
    "\n",
    "#show2('lisi', {'chinese':89,'english':78, 'math':96, 'physics':88})\n",
    "show2('lisi', chinese=89, english=78, math=96, physics=88)\n",
    "\n",
    "def test_args_kwargs(a,b, *args, **kwargs):\n",
    "    print(a,b)\n",
    "    c= args\n",
    "    print(c)\n",
    "    dict = kwargs\n",
    "    for k,v in dict.items():\n",
    "        print(k,v)\n",
    "    \n",
    "test_args_kwargs(1,2,3,4,5, weather=30,tempreature=22)"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "base",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.13.5"
  },
  "orig_nbformat": 4
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
